﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>首页</title>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>

    <script>
        //将数据库中工资前十的公司和工资依次放到页面十个模块中
        $(document).ready(function () {

           /**
            * 为查找按钮绑定点击事件，将搜索框内的文本传给job_info.html
            */
           $("#search_btn").click(function () {
              var mess = $("[name='chazhao']").val();
              sessionStorage.setItem("mess", mess);
           });

            showSlide();
            $.get("po/SelectHighSal", function (rs) {
                const objects = rs.result;
                $('.divBox').each(function (index) {
                    if (index < objects.length) {
                        // 更新每个 .divBox 内部的 p 元素的内容
                        $(this).find('.tit a').text(objects[index].pname);
                        $(this).find('.sub a').text(objects[index].business);
                        $(this).find('p.num span').text(objects[index].sal);
                    }
                });
            });
        });

        $("#search_btn").click(function () {
           var mess = $("[name='chazhao']").val();
           sessionStorage.setItem("mess", mess);
        });
        //当点击公司名时跳转并将点击公司名传给下一个界面
        $(document).on("click",'p.sub a',function () {
            const business = $(this).text();
            var pname = $('.tit a').text();
            sessionStorage.setItem("pname",pname);
            sessionStorage.setItem("business", business);
        });
        //当点击职业跳转并将点击职业名传给下一个界面
        $(document).on("click", 'p.tit a', function () {
            // 获取当前点击的职位名称
            const pname = $(this).text();
            // 获取同一 divBox 中的公司名称
            const business = $(this).closest('.divBox').find('p.sub a').text();
            // 将职位名称和公司名称存入 sessionStorage
            sessionStorage.setItem("pname", pname);
            sessionStorage.setItem("business", business);
        });
        //动态切换图片
        function showSlide() {
           let currentIndex = 0;
           const slides = document.querySelectorAll('#imageSlider li');
           const totalSlides = slides.length;
           function showSlide(index) {
              slides.forEach((slide, i) => {
                 slide.style.display = (i === index) ? 'block' : 'none';
              });
           }
           function nextSlide() {
              currentIndex = (currentIndex + 1) % totalSlides;
              showSlide(currentIndex);
           }
           showSlide(currentIndex);
           setInterval(nextSlide, 2000);
        }
    </script>


</head>

<body>
<div class="topDiv">
</div>
<div class="loginDiv">
    <div class="loginL">
        <img src="images/LOGO.png"/>
        <img src="images/view_logo40.png"/>
    </div>
    <div class="loginAddress">
        <div class="add1">
        </div>
    </div>
    <div class="loginC">
        <input name="chazhao" type="text" placeholder="请填写关键词或选择职位..."/>
        <button id="search_btn">     </button>
    </div>
    <div class="loginR">
        <img src="images/spirit_40.png"/>
    </div>
</div>
<div class="menuDiv">
    <a href="index.html" class="onnav">首页</a>
    <a href="personal_resume.html">个人中心</a>
    <a href="personal_selected.html">我的职位</a>
</div>
<div class="BodyMain">
    <div class="mainTop">
        <div class="mainTopL">
            <ul>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme1" style="color: #0BC10A"><b></b>销售|市场|客服|贸易</span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme2" style="color: #0BC10A"><b></b>经营管理|人事|行政|财务</span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme3" style="color: #0BC10A"><b></b>生产|质管|技工|物流</span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme4" style="color: #0BC10A"><b></b>教育|法律|咨询|翻译</span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme5" style="color: #0BC10A"><b></b>零售|家政|餐饮|旅游</span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme6" style="color: #0BC10A"><b></b>广告|媒体|艺术|出版</span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme7" style="color: #0BC10A"><b></b>IT|互联网|通信</span>
                    </div>
                </div>
            </ul>
        </div>
        <div class="mainTopR">
            <div class="ads">
                <div class="floatL" id="left"></div>
                <div class="adBox0">
                    <ul id="imageSlider" style="margin-left: 0px; overflow: hidden">
                        <li>
                            <a href="javascript:void(0)">
                                <div style="background:url(images/1.jpg);background-size: cover;background-repeat: no-repeat;background-position: center"></div>
                            </a>
                        </li>
                        <li>
                            <a href="javascript:void(0)">
                                <div style="background:url(images/2.jpg);background-size: cover;background-repeat: no-repeat;background-position: center"></div>
                            </a>
                        </li>
                        <li>
                            <a href="javascript:void(0)">
                                <div style="background:url(images/3.gif);background-size: cover;background-repeat: no-repeat;background-position: center"></div>
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
            <div class="login">
                <div class="erweima">
                    <div class="close"></div>
                    <div class="ewmimg"><img src="images/showqrcode.jpg"/></div>
                    <div class="ewmtxt">使用微信扫描上方二维码登录</div>
                </div>
                <div class="logintop">
                    <div class="loginC loginA select">
                        <span>个人登录</span>
                    </div>
                    <div class="loginC loginB">
                    </div>
                </div>
                <div class="loginmain">
                    <div class="ContentA">
                        <div class="txtInput"><input name="" type="text" placeholder="请输入用户名"/></div>
                        <div class="txtInput"><input name="" type="text" placeholder="请输入密码"/></div>
                        <div class="txtbtn">
                            <div style="float:left">
                                <br/>
                                <div class="clear"></div>
                                <a href="password.html" class="a2">忘记密码</a>
                            </div>
                            <input name="" type="button" class="lobtn" value="登  录"/>
                        </div>
                        <div class="zcbox">
                            <div class="zc2">
                                <a href="resume.html" class="a1">一分钟填写简历</a>
                                <a href="register.html" class="a2">注册</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="clear"></div>
    <div class="mainCon2">
        <div class="commontitdiv">
            <div class="title">高薪职位</div>
            <span>高薪就这么任性！</span>
        </div>
        <div class="clear"></div>
        <div class="highMoney">
            <div class="divBox">
                <a href="job_info.html" class="pict"><img src="images/20.gif" width="84"/></a>
                <p class="tit"><a href="job_info.html"></a></p>
                <p class="sub"><a href="company.html" title="1"></a></p>
                <p class="num"><span>8K-10K</span></p>
            </div>
            <div class="lineBox"></div>
            <div class="divBox">
                <a href="job_info.html"><img src="images/19.gif" width="84"/></a>
                <p class="tit"><a href="job_info.html"></a></p>
                <p class="sub"><a href="company.html"></a></p>
                <p class="num"><span>8K-10K</span></p>
            </div>
            <div class="lineBox"></div>
            <div class="divBox">
                <a href="job_info.html"><img src="images/20.gif" width="84"/></a>
                <p class="tit"><a href="job_info.html"></a></p>
                <p class="sub"><a href="company.html"></a></p>
                <p class="num"><span>8K-10K</span></p>
            </div>
            <div class="lineBox"></div>
            <div class="divBox">
                <a href="job_info.html"><img src="images/20.gif" width="84"/></a>
                <p class="tit"><a href="job_info.html"></a></p>
                <p class="sub"><a href="company.html"></a></p>
                <p class="num"><span>8K-10K</span></p>
            </div>
            <div class="lineBox"></div>
            <div class="divBox">
                <a href="job_info.html"><img src="images/22.gif" width="84"/></a>
                <p class="tit"><a href="job_info.html"></a></p>
                <p class="sub"><a href="company.html"></a></p>
                <p class="num"><span>8K-10K</span></p>
            </div>
            <div class="lineBox"></div>
            <div class="divBox">
                <a href="job_info.html"><img src="images/23.gif" width="84"/></a>
                <p class="tit"><a href="job_info.html"></a></p>
                <p class="sub"><a href="company.html"></a></p>
                <p class="num"><span>8K-10K</span></p>
            </div>
            <div class="lineBox"></div>
            <div class="divBox">
                <a href="job_info.html"><img src="images/24.gif" width="84"/></a>
                <p class="tit"><a href="job_info.html"></a></p>
                <p class="sub"><a href="company.html"></a></p>
                <p class="num"><span>8K-10K</span></p>
            </div>
            <div class="lineBox"></div>
            <div class="divBox">
                <a href="job_info.html"><img src="images/25.gif" width="84"/></a>
                <p class="tit"><a href="job_info.html"></a></p>
                <p class="sub"><a href="company.html"></a></p>
                <p class="num"><span>8K-10K</span></p>
            </div>
            <div class="lineBox"></div>
            <div class="divBox">
                <a href="job_info.html"><img src="images/26.gif" width="84"/></a>
                <p class="tit"><a href="job_info.html"></a></p>
                <p class="sub"><a href="company.html"></a></p>
                <p class="num"><span>8K-10K</span></p>
            </div>
            <div class="lineBox"></div>
            <div class="divBox">
                <a href="job_info.html"><img src="images/27.gif" width="84"/></a>
                <p class="tit"><a href="job_info.html"></a></p>
                <p class="sub"><a href="company.html"></a></p>
                <p class="num"><span>8K-10K</span></p>
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<div class="footerLine"></div>
<div class="footer">
    <div class="footerdown">
    </div>
</div>
</body>
<script>
    $(function () {
        $("#search_btn").on("click", function () {
            window.location = "searchJob.html"
        });
    });
</script>
</html>
